#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<time.h>
#include<ctype.h>
#include<assert.h>
int main() {
    int y,m;
    int days;

    scanf("%d%d",&y,&m);
    if(y<=0||m>12||m<=0)
        days=-1;
    else if (m==1 || m==3 ||m==5||m==7||m==8||m==10||m==12)
        days=31;
    else if(m==4||m==6||m==9||m==11)
        days=30;
    else {
        if(y%4==0&&y%100!=0 || y%400==0)
            days=29;
        else
            days=28;
    }

    if(days>0)
        printf("%d\n",days);
    else
        puts("Are you kidding...");



    return 0;
}
